package lormi.meipin.entity;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

import lormi.meipin.dto.PositionAddDto;
import lormi.meipin.dto.PositionEditDto;

public class Position {
	
    private Integer id;

    private Integer merid;

    private Integer positionclass;

    private String education;

    private String title;

    private Long salarymin;

    private Long salarymax;

    private Integer hostcity;
    
    private String cityname;

    private Byte experience;

    private String description;

    private Date createtime;

    private Date updatetime;
    
    private Integer hidden;

	public Position(PositionAddDto positionAddDto,String title) {
		super();
		this.merid = positionAddDto.getUserid();
		this.positionclass = positionAddDto.getPositionclass();
		this.title = title;
		this.salarymin = positionAddDto.getSalarymin();
		this.salarymax = positionAddDto.getSalarymax();
		this.hostcity = positionAddDto.getCityid();
		this.experience = positionAddDto.getExperience();
		this.description = positionAddDto.getDescription();
		this.createtime = new Date();
		this.updatetime = this.createtime;
		this.hidden = 1;
	}
	
	public Position(PositionEditDto positionEditDto,String title) {
		super();
		this.id = positionEditDto.getId();
		this.merid = positionEditDto.getUserid();
		this.positionclass = positionEditDto.getPositionclass();
		this.title = title;
		this.salarymin = positionEditDto.getSalarymin();
		this.salarymax = positionEditDto.getSalarymax();
		this.hostcity = positionEditDto.getCityid();
		this.experience = positionEditDto.getExperience();
		this.description = positionEditDto.getDescription();
		this.hidden = 1;
		this.updatetime = new Date();
	}

	public Position() {
		super();
	}

	public Integer getHidden() {
		return hidden;
	}

	public void setHidden(Integer hidden) {
		this.hidden = hidden;
	}

	public String getCityname() {
		return cityname;
	}

	public void setCityname(String cityname) {
		this.cityname = cityname;
	}

	public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getMerid() {
        return merid;
    }

    public void setMerid(Integer merid) {
        this.merid = merid;
    }

    public Integer getPositionclass() {
        return positionclass;
    }

    public void setPositionclass(Integer positionclass) {
        this.positionclass = positionclass;
    }

    public String getEducation() {
        return education;
    }

    public void setEducation(String education) {
        this.education = education == null ? null : education.trim();
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public Long getSalarymin() {
        return salarymin;
    }

    public void setSalarymin(Long salarymin) {
        this.salarymin = salarymin;
    }

    public Long getSalarymax() {
        return salarymax;
    }

    public void setSalarymax(Long salarymax) {
        this.salarymax = salarymax;
    }

    public Integer getHostcity() {
        return hostcity;
    }

    public void setHostcity(Integer hostcity) {
        this.hostcity = hostcity;
    }

    public Byte getExperience() {
        return experience;
    }

    public void setExperience(Byte experience) {
        this.experience = experience;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    @JsonFormat(pattern = "yyyy年M月d日")
    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    @JsonFormat(pattern = "yyyy年M月d日")
    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }
}